package com.googlecode.q2xml.util;

import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.IOException;

public class IOUtil
{
	public static byte[] readFile(String filePath) throws IOException
	{

		FileInputStream inputStream = new FileInputStream(filePath);
		ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
		
		int c=0; byte[] buff = new byte[1024];
		
		while ( (c = inputStream.read(buff)) != -1)
			outputStream.write(buff, 0, c);
		
		inputStream.close();
		outputStream.close();
		
		return outputStream.toByteArray();
	
	}
}
